Creating and Configuring a Custom Connector |
|
Before you begin this task:
- Install Process Platform.
- You must have the role Developer.
Process Platform provides a set of default Application Connectors that process the business logic and provide connectivity to various back ends. Apart from these, you can build your own custom connector to connect to any specific back end. When the default set of connectors do not serve the purpose for your Process Platform based custom applications, you can choose to create a custom connector.
After creating a custom connector, it is essential to configure it to the Process Platform framework to enable connectivity. Process Platform provides a feature to provide a user-friendly interface to configure the custom connectors. After configuration, you can find the schema of this interface at CUSP > My Applications > XMLStore Explorer () > Collection > Cordys > WCP > Application Connector.
- Create two java files by extending ApplicationConnector class and implementing ApplicationTransaction class. Ensure to override the below indicated Web service operations:
Java Class
Web service operations to be overridden
* open() - This is invoked by the service container after establishing the connection to the Process Platform ESB.
* close() - This is invoked by the service container after closing the connection to the Process Platform ESB.
* reset() - This is invoked by the service container to clear the cache.
* createTransaction() - This is invoked by the service container to indicate the arrival of a new message and creation of a SOAPTransaction for it.* commit() - This is invoked by the SOAPTransaction, when the entire SOAPTransaction succeeds and can be committed.
* abort() - This is invoked by the SOAPTransaction, when one of the ApplicationTransactions has returned false during the process() method.
* canProcess() - This method returnsTrue, if the XML mapper can process Web service operations defined of the specified type such as SQL, Java, LDAP and so on.
* process() - This is invoked to process the relevant body blocks within this transaction.Note:
For more information about these Web service operations, refer to Java SDK documentation. - Generate a JAR file for the above indicated Java files.Note: This JAR file will be used while registering the custom connector.
- Create a HTML file, include /cordys/wcp/admin/behavior/applicationconnector.js and add the method initialize() as an event-handler to the application's onapplicationready event.
- In this HTML file, create the implementation for the following Web service operations: createConnectorConfiguration() and fillInPropertyScreen(). For details on implementation of Web service operations, refer to Custom Connector APIs.
- Create a custom Web service interface with the necessary Web service operations.
- Configure your connector and associate with the framework using the HTML page, implementation class (java class) and publish the connector. Follow the below steps to configure the connector:
- Create a project in CWS.
- Select a starting point and click to open the Application Connector Editor.The Untitled Application Connector - Application Connector window appears.
- Provide Configuration information in the <Application Connector Name> - Application Connectorwindow.
Note:
Ensure to provide the Implementation Class and Property Page details during configuration. If not, the custom connector will not be available for deployment. - Click . The Save Document dialog box appears.
- Provide the Name and Description, and click to browse and select the location to save the connector. The folder path where the connector will be created appears in the Save in Folder field.
- Close the Application Connector window.
The custom Application Connector is created and configured with the provided name and is stored at the selected location.
After you complete this task
- Publish the custom Application Connector.
- Create a Service Group and during the process ensure to select the custom connector and custom Web service interface that you have created in the previous steps. The configuration page for the Application Connector would be taken from the Property Page URL mentioned while configuring the connector.
- Deploy the custom Web service interface in the XForms.
Note: To modify a configuration of a custom Application Connector, refer to Editing or Deleting Custom Connectors.